package com.kgc.kmall.kmallcloudmanagerservice.controller;

import com.kgc.kmall.bean.PmsBaseSaleAttr;
import com.kgc.kmall.bean.PmsProductInfo;
import com.kgc.kmall.bean.PmsProductSaleAttr;
import com.kgc.kmall.service.SpuService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SpuController {

    @Resource
    SpuService spuService;
    @RequestMapping("/spuList/{catalog3Id}")
    public List<PmsProductInfo> spuList(@PathVariable Long catalog3Id){
        List<PmsProductInfo> infoList = spuService.spuList(catalog3Id);
        return infoList;
    }

    //根据id查询spu
    @RequestMapping("/spuSaleAttrList/{spuId}")
    public List<PmsProductSaleAttr> spuSaleAttrList(@PathVariable Long spuId){
        List<PmsProductSaleAttr> saleAttrList=spuService.spuSaleAttrList(spuId);
        return saleAttrList;
    }

}
